pro sandbox

  ; examine mie programs
  Dx = 1
  Cm = DComplex(1.42,-0.002)
  mie_single,Dx,Cm,Dqxt,Dqsc,Dqbk,Dg

  print,'Dx=',Dx
  print,'Cm=',Cm
  print,'Dqxt=',Dqxt
  print,'Dqsc=',Dqsc
  print,'Dqbk=',Dqbk
  print,'Dg=',Dg

  ; examine GenLogNormal
  N = 100 ; cm-3
  Rm = 0.3 ; micron
  logSigma = 1.54
  GenLogNormal,n_r,r,N=N,d0=Rm,logSigma=logSigma,size_r=100,xWidthRatio=5

  plot,r,n_r,/xlog,/ylog,$
    xtitle='Radius (micron)',$
    ytitle='n(r) (cm!U-3!Nmicron!U-1!N)'
  ;integrate
  number_r = n_elements(r)
  dr = r[1:number_r-1]-r[0:number_r-2]
  print,total(dr*n_r[0:number_r-2])

  ; examine mie_dist
  lambda = 0.5d ; micron
  Mie_dist,n_r,r,lambda,Cm,Kxt,Ksc,Kbk

  print,'Kxt=',Kxt
  print,'Ksc=',Ksc
  print,'Kbk=',Kbk
  print,'w=',Ksc/Kxt

  Mie_lognormal,N, Rm, logSigma, 1d/double(lambda), Cm, Bext, Bsca, w, g

  print,'Bext=',Bext
  print,'Bsca=',Bsca
  print,'w=',w
  print,'g=',g

end
